﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;

namespace EFashion.Employee
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        static public String img_forward_img_name = "-1";
        static public String img_backward_img_name = "-1";
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_upload_img_Click(object sender, EventArgs e)
        {
            bool bUpload = false;
            if (img_forward.HasFile)
            {
                String filepath = img_forward.PostedFile.FileName;
                String filename = Path.GetFileName(filepath);
                img_forward.PostedFile.SaveAs(Server.MapPath("~/images/SanPham/") + filename);
                img_forward_img_name = filename;
                bUpload = true;
            }
            if (img_backward.HasFile)
            {
                String filepath = img_backward.PostedFile.FileName;
                String filename = Path.GetFileName(filepath);
                img_backward.PostedFile.SaveAs(Server.MapPath("~/images/SanPham/") + filename);
                img_backward_img_name = filename;
                bUpload = true;
            }

            if (bUpload == true)
            {
                Response.Write("Tải hình đại diện thành công.");
            }

        }
    }
}

